<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body,
      ul {
        margin: 0;
        padding: 0;
      }
      body {
        width: 100%;
        height: 100%;
        background-image: url(../../images/grid.png);
      }
      svg {
        background-color: rgba(255, 0, 0, 0.1);
      }

      #line1 {
        stroke-dasharray: 100px;
        stroke-dashoffset: 0px;
        animation: line1Move 3s linear;
      }
      /* 可见到不可见 */
      @keyframes line1Move {
        0% {
          stroke-dashoffset: 100px;
        }

        100% {
          stroke-dashoffset: 0px;
        }
      }
    </style>
  </head>
  <body>
    <svg width="300" height="300">
      <line
        id="line1"
        x1="100"
        y1="70"
        x2="200"
        y2="70"
        stroke="red"
        stroke-width="10"
      ></line>
    </svg>
  </body>
</html>
